import uuid



from django.db import models

# Create your models here.


class PersonalInfo(models.Model):
    name = models.CharField(max_length=50, verbose_name="姓名")
    graduate_year = models.CharField(max_length=10, verbose_name="应届年份", help_text="如“24年应届生”")
    education = models.CharField(max_length=20, verbose_name="学历")
    job_status = models.CharField(max_length=50, verbose_name="求职状态", help_text="如“在校-考虑机会”")
    phone = models.CharField(max_length=20, verbose_name="手机号")
    resume_score = models.IntegerField(verbose_name="简历专业评分")
    optimization_items = models.IntegerField(verbose_name="待优化项数量")
    preponderance = models.CharField(max_length=50, verbose_name="个人优势")
    expectedJob = models.CharField(max_length=50, verbose_name="期望职位")
    created_at = models.DateTimeField(auto_now_add=True)



    class Meta:
        db_table = "personal_info"
        verbose_name = "个人基本信息"
        verbose_name_plural = verbose_name


class WorkExperience(models.Model):
    company = models.CharField(max_length=100, verbose_name="公司名称")
    position = models.CharField(max_length=100, verbose_name="职位")
    start_date = models.DateField(verbose_name="开始日期")
    end_date = models.DateField(verbose_name="结束日期", null=True, blank=True, help_text="若未结束可留空")
    description = models.TextField(verbose_name="工作描述", help_text="负责的工作内容、成果等")
    personal_info = models.ForeignKey(PersonalInfo, on_delete=models.CASCADE, related_name="work_experiences", verbose_name="关联个人信息")

    class Meta:
        db_table = "work_experience"
        verbose_name = "工作/实习经历"
        verbose_name_plural = verbose_name


class ProjectExperience(models.Model):
    project_name = models.CharField(max_length=100, verbose_name="项目名称")
    role = models.CharField(max_length=50, verbose_name="项目角色", help_text="如“开发工程师、负责人”")
    start_date = models.DateField(verbose_name="开始日期")
    end_date = models.DateField(verbose_name="结束日期", null=True, blank=True, help_text="若未结束可留空")
    description = models.TextField(verbose_name="项目描述", help_text="项目背景、技术栈、个人负责内容、成果等")
    personal_info = models.ForeignKey(PersonalInfo, on_delete=models.CASCADE, related_name="project_experiences", verbose_name="关联个人信息")

    class Meta:
        db_table = "project_experience"
        verbose_name = "项目经历"
        verbose_name_plural = verbose_name

class EducationExperience(models.Model):
    school = models.CharField(max_length=100, verbose_name="学校名称")
    education = models.CharField(max_length=20, verbose_name="学历")
    major = models.CharField(max_length=50, verbose_name="专业", null=True, blank=True)
    start_date = models.DateField(verbose_name="入学日期")
    end_date = models.DateField(verbose_name="毕业日期")
    description = models.TextField(verbose_name="教育描述", null=True, blank=True, help_text="如获奖、担任职务等")
    personal_info = models.ForeignKey(PersonalInfo, on_delete=models.CASCADE, related_name="education_experiences", verbose_name="关联个人信息")

    class Meta:
        db_table = "education_experience"
        verbose_name = "教育经历"
        verbose_name_plural = verbose_name


